package com.binyouwei.designpatterns.behavior.observer;

/**
 * @author 宾有为
 * @date 2024/7/17 19:58
 * @link https://blog.csdn.net/baidu_41616022?type=blog
 * @describe：观察者模式 - 观察者类
 **/
public class OctalObserver extends Observer{

    public OctalObserver(ObserverSubject subject){
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println( "Octal String: "
                + Integer.toOctalString( subject.getState() ) );
    }
}